package com.flyme.module.order.client.api;


import com.flyme.common.core.model.ResultBody;
import com.flyme.common.core.model.query.PagerInfo;
import com.flyme.module.order.client.entity.Order;
import org.springframework.web.bind.annotation.*;

import java.math.BigDecimal;

/**
 * @author zyf
 */
@RequestMapping("/order")
public interface OrderRemoteService {

    /**
     * 订单列表
     *
     * @return
     */
    @PostMapping("/list")
    ResultBody list(@ModelAttribute(value = "pagerInfo") PagerInfo pagerInfo, Order order);

    /**
     * 根据ID查询详情
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/get/{id}")
    ResultBody get(@PathVariable Long id);

    /**
     * 更新订单
     *
     * @param order
     * @return
     */
    @PostMapping("/update")
    ResultBody update(@ModelAttribute(value = "exam") Order order);

    /**
     * 删除订单
     *
     * @param ids
     * @return
     */
    @PostMapping(value = "/delByIds")
    ResultBody delByIds(@RequestParam("ids") String[] ids);

    /**
     * 订单退款
     *
     * @param orderId
     * @return
     */
    @PostMapping(value = "/returnOrder")
    ResultBody returnOrder(@RequestParam("orderId") Long orderId, @RequestParam("returnAmount") BigDecimal returnAmount, @RequestParam("returnDate") String returnDate, @RequestParam("reason") String reason);


}
